<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let age = +prompt('请输入你的年龄')
    // age >= 18 ? alert('跟我去网吧偷耳机'):alert('未成年滚回家写作业去')
    if (age >= 18){
      alert('跟我去网吧偷耳机')
    }else if (age < 18 && age > 0) {
      alert('未成年滚回家写作业去')
    } else {
      alert('请输入年龄')
    }
  </script>
</body>
</html>